<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./WEB-INF/includes/template.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core">

    <ui:define name="title">
        我的日程--OfficeBoost System
    </ui:define>


    <ui:define name="content">
        <h:form>  

            <p:growl id="messages" showDetail="true" />  

            <p:schedule value="#{scheduleController.eventModel}" widgetVar="myschedule">  

                <p:ajax event="dateSelect" listener="#{scheduleController.onDateSelect}" update="eventDetails" oncomplete="eventDialog.show()" />  
                <p:ajax event="eventSelect" listener="#{scheduleController.onEventSelect}" update="eventDetails" oncomplete="eventDialog.show()" />  
                <p:ajax event="eventMove" listener="#{scheduleController.onEventMove}" update="messages" />  
                <p:ajax event="eventResize" listener="#{scheduleController.onEventResize}" update="messages" />  

            </p:schedule>  

            <p:dialog widgetVar="eventDialog" header="日程详情" showEffect="clip" hideEffect="clip">  
                <h:panelGrid id="eventDetails" columns="2">  
                    <h:outputLabel for="title" value="内容：" />  
                    <p:inputText id="title" value="#{scheduleController.event.title}" required="true"/>  

                    <h:outputLabel for="from" value="起始：" />  
                    <p:inputMask id="from" value="#{scheduleController.event.startDate}" mask="99/99/9999">  
                        <f:convertDateTime pattern="dd/MM/yyyy" />  
                    </p:inputMask>  

                    <h:outputLabel for="to" value="终止：" />  
                    <p:inputMask id="to" value="#{scheduleController.event.endDate}" mask="99/99/9999">  
                        <f:convertDateTime pattern="dd/MM/yyyy" />  
                    </p:inputMask>    
                    <p:commandButton value="添加" actionListener="#{scheduleController.addEvent}" oncomplete="myschedule.update();eventDialog.hide();"/> 
                    <p:commandButton value="删除" actionListener="#{scheduleController.deleteEvent}" oncomplete="myschedule.update();eventDialog.hide();"/> 

                </h:panelGrid>  
            </p:dialog>  

        </h:form>
    </ui:define>     
</ui:composition>
